﻿namespace PoemGame.Query
{
    /// <summary>
    /// 玩家查询接口
    /// </summary>
    public interface IPlayerQuery
    {
        /// <summary>
        /// 根据Id查询玩家
        /// </summary>
        /// <param name="playerId"></param>
        /// <returns></returns>
        Task<PlayerRes?> GetPlayerResAsync(Guid playerId);
        /// <summary>
        /// 根据条件查询玩家
        /// </summary>
        /// <param name="wherecondition">查询条件</param>
        /// <param name="orderby">排序字段</param>
        /// <returns></returns>
        Task<IEnumerable<PlayerRes>> GetPlayersByConditionAsync(
            string wherecondition);
        /// <summary>
        /// 根据条件查询玩家，获取分页结果
        /// </summary>
        /// <param name="pageindex">起始页从1开始</param>
        /// <param name="pagesize">每页记录数</param>
        /// <param name="wherecondition">条件的where表达式</param>
        /// <param name="orderby">排序字段</param>
        /// <returns></returns>
        Task<IEnumerable<PlayerRes>> GetPagedPlayersByConditionAsync(
            int pageindex,
            int pagesize, 
            string wherecondition,
            string orderby);
        /// <summary>
        /// 符合条件的记录数
        /// </summary>
        /// <param name="wherecondition"></param>
        /// <returns></returns>
        Task<long> GetPlayersCountByConditionAsync(
            string wherecondition);
    }
}
